package com.gitee.deament.server.core.data;


import com.gitee.deament.server.config.SystemConfig;
import com.gitee.deament.server.core.data.storage.SelectDBStorage;
import com.gitee.deament.server.core.data.storage.UserStorage;
import com.gitee.deament.server.core.data.storage.impl.MemorySelectDBStorage;
import com.gitee.deament.server.core.data.storage.impl.MemoryUserStorage;

/**
 * 连接数据存储
 * @author deament
 */
public class ConnectData {

    public static UserStorage USER_STORAGE = new MemoryUserStorage();
    public static SelectDBStorage SELECT_DB_STORAGE =new MemorySelectDBStorage();


    public static void userQuitEvent(String channelId){
        USER_STORAGE.authDelete(channelId);
        SELECT_DB_STORAGE.removeChannel(channelId);
        SystemConfig.SYSTEM_INFO.decreaseClientNum();
    }

    public static  void userAddEvent(String channelId){
        SystemConfig.SYSTEM_INFO.IncreaseClientNum();
    }


}
